<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%String root = request.getContextPath(); %>  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ko">
<head>
<title>자유 게시판</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=root%>/css/board/skin.css" type="text/css">
<script type="text/javascript">
function goPage(pg){
	document.mvform.bid.value = '<s:property value="%{bid}"/>';
	document.mvform.pg.value = pg;
	document.mvform.key.value = '<s:property value="%{key}"/>';
	document.mvform.word.value = '<s:property value="%{word}"/>';
	document.mvform.action="<%=root%>/board/list.action";
	document.mvform.submit();
}
</script>
</head>

<body>
<form name="mvform" method="get" action="">
<input type="hidden" name="bid" value="">
<input type="hidden" name="pg" value="">
<input type="hidden" name="key" value="">
<input type="hidden" name="word" value="">
</form>
<!-- title start -->
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td><img src="<%=root%>/img/board/m_icon_board.gif" width="9"
			height="9" border="0" align="absmiddle" style="margin-top: -2px">
		<b>자유게시판</b> &nbsp;<font style="font-size: 8pt">|</font>&nbsp; 자유로운 글을
		올리는 공간입니다<br>
		</td>
		<td align="right"></td>
	</tr>
	<tr>
		<td colspan="2" height="19"></td>
	</tr>
</table>
<!-- title end -->

<s:url id="mvnew" namespace="/board" action="mvnew">
	<s:param name="bid" value="%{bid}"/>
	<s:param name="pg" value="1"/>
	<s:param name="key" value="%{key}"/>
	<s:param name="word" value="%{word}"/>
</s:url>

<!-- bbs start -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr valign="bottom">
		<td nowrap><s:a href="%{mvnew}"><img
			src="<%=root%>/img/board/btn_write_01.gif" width="64" height="22"
			border="0" align="absmiddle" alt="글쓰기"></s:a></td>

		<td width="100%" style="padding-left: 6px" valign="bottom">새글 <b><font
			class="text_acc_02"><s:property value="%{navigation.newArticleCount}"/></font></b> / 전체 <font
			class="text_acc_02"><s:property value="%{navigation.totalArticleCount}"/></font></td>
		<td width="300" nowrap>
		<div align="right"></div>
		</td>
	</tr>
	<tr>
		<td colspan="2" height="5" style="padding: 0px"></td>
	</tr>
</table>

<form name="listForm" method="post" style="margin: 0px">
<table width="100%" cellpadding="5" cellspacing="0" border="0">
	<tr>
		<td class="bg_board_title_02" height="2" colspan="11"
			style="overflow: hidden; padding: 0px"></td>
	</tr>
	<tr class="bg_board_title" align="center" height="28">
		<td nowrap><b>번호</b></td>
		<td nowrap class="board_bar" style="padding: 0px">|</td>
		<td></td>
		<td width="100%"><b>제목</b></td>
		<td nowrap class="board_bar" style="padding: 0px">|</td>
		<td width="120" nowrap><b>글쓴이</b></td>
		<td nowrap class="board_bar" style="padding: 0px">|</td>
		<td nowrap><b>조회</b></td>
		<td nowrap class="board_bar" style="padding: 0px">|</td>
		<td width="45" nowrap><b>날짜</b></td>
	</tr>
	<tr>
		<td class="bg_board_title_02" height="1" colspan="11"
			style="overflow: hidden; padding: 0px"></td>
	</tr>

	<!-- 공지기능 적용시 -->


	<!-- 공지기능 적용끝  -->
<s:if test="%{articleList==null || articleList.size() == 0}">
	<tr>
		<td colspan="10" class="text_gray">
		작성된 글이 없습니다.
		</td>
	</tr>
</s:if>
<s:else>
	<s:iterator value="%{articleList}">
	<tr>
		<td align="center" class="text_gray"><s:property value="%{seq}"/></td>
		<td></td>
		<td nowrap class="onetext" style="padding-right: 5px"></td>
		<!--td>
     
     </td-->
		<td style="word-break: break-all;">
		<s:url id="hiturl" action="updatehit" namespace="/board">
			<s:param name="bid" value="%{bid}"/>
			<s:param name="pg" value="%{pg}"/>
			<s:param name="key" value="%{key}"/>
			<s:param name="word" value="%{word}"/>
			<s:param name="seq" value="%{seq}"/>
		</s:url>
		<s:a href="%{hiturl}"
			cssClass="link_board_03">
			<img src="<%=root%>/img/board/blank.gif" height="1" width="<s:property value="%{lev * 15}"/>">
			<s:property value="%{subject}"/>&nbsp;&nbsp;&nbsp;</s:a></td>
		<td></td>
		<td style="word-break: break-all;"><a href="javascript:;"
			onClick="showSideView();" class="link_board_04"><s:property value="%{name}"/></a></td>
		<td></td>
		<td align="center" class="text_gray"><s:property value="%{hit}"/></td>
		<td></td>
		<td align="center" class="text_gray"><s:property value="%{logtime}"/></td>
	</tr>

	<tr>
		<td bgcolor="#ededed" height="1" colspan="11"
			style="overflow: hidden; padding: 0px"></td>
	</tr>
	</s:iterator>
</s:else>
	<tr>
		<td class="bg_board_title_02" height="1" colspan="11"
			style="overflow: hidden; padding: 0px"></td>
	</tr>
</table>
</form>
<!-- bbs end -->

<!-- 하단 페이징 -->
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td colspan="3" height="5"></td>
	</tr>
	<tr valign="top">
		<td nowrap><s:a href="%{mvnew}"><img
			src="<%=root%>/img/board/btn_write_01.gif" width="64" height="22"
			border="0" align="absmiddle" alt="글쓰기"></s:a></td>
		<td width="100%" align="center"><!--PAGE--> <s:property value="%{navigation.navigate}" escape="false"/></td>
		<td nowrap class="stext"><b><s:property value="%{navigation.currentPage}"/></b> / <s:property value="%{navigation.totalPageCount}"/>
		pages</td>
	</tr>
</table>
<br>
<!-- 하단 페이징 -->

<!-- 검색 영역-->
<s:form name="searchForm" method="get" action="list" namespace="/board"
	cssStyle="margin: 0px">
<s:hidden name="bid" value="%{bid}"/>
<s:hidden name="pg" value="%{pg}"/>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td colspan="3" height="10"></td>
	</tr>
	<tr>
		<td width="50%"></td>
		<td nowrap><select name="key" class="inp">
			<option value="subject">글제목
			<option value="name">글쓴이
			<option value="seq">글번호
		</select> <span id="sear1"> <input type="text" name="word" size="22"
			class="inp" style="margin-top: -19px;"> </span> 
			<input type="image" src="<%=root%>/img/board/sbtn_s.gif" width="32" height="18"
			border="0" align="absmiddle" alt="검색"> 
			
		<s:if test="%{#session.userInfo != null}">	
			<s:url id="listurl" action="list" namespace="/board">
				<s:param name="bid" value="%{bid}"/>
				<s:param name="pg" value="1"/>
				<s:param name="key">id</s:param>
				<s:param name="word" value="%{#session.userInfo.id}"/>
			</s:url>
			<s:a href="%{listurl}"><img
			src="<%=root%>/img/board/sbtn_mytext.gif" width="82" height="20"
			align="absmiddle" alt="내가 쓴 글 보기"></s:a><br>
		</s:if>
		
		</td>
		<td width="50%" align="right"><a href="#"><img
			src="<%=root%>/img/board/sbtn_top.gif" width="24" height="11"
			align="absmiddle" alt="TOP"></a><br>
		</td>
	</tr>
</table>
</s:form>
</body>
</html>

